package 周赛;

public class 石子游戏 {
    public boolean stoneGameIX(int[] stones) {
        int[] s = {0, 0, 0};
        for (int i : stones) ++s[i % 3];
        if (s[0] % 2 == 0) return s[1] != 0 && s[2] != 0;
        return s[2] > s[1] + 2 || s[1] > s[2] + 2;
    }
}
